/**
 * 
 */


function Score(mid,kor,eng,tot,avg){
	this.mid=mid;
	this.kor=kor;
	this.eng=eng;
	this.tot=0;
	this.avg=0;
	this.compute=function(){
		this.tot=this.kor+this.eng;
		this.avg=this.tot/2;
	}

	cnt=0;
	this.getMid=function(){return this.mid;}
	this.getKor=function(){return this.kor;}
	this.getEng=function(){return this.eng;}
	this.getTot=function(){return this.tot;}
	this.getAvg=function(){return this.avg;}
	
	document.getElementById("compute").onclick=btnCF;
	document.getElementById("view").onclick=btnVF;
	alert(this.tot);
}
s.compute();
array.push(s);
var array = new Array();
var s = new Score(this.mid+this.kor+this.eng+this.tot+this.avg);
var f=document.frm;
function btnCF(){
	alert(this.tot);
	
	
	f.tot.value=this.tot;
	f.avg.value=this.avg;
	

}


function btnVF(){
	alert(array[0].mid);
	var rst=document.getElementById("result");
	rst.innerHTML=array.mid
	/*for(a=0;a<array.length;a++){
		rst.innerHTML=array[a].getMid+array[a].getKor+array[a].getEng+array[a].getTot+array[a].getAvg;
	}*/

}